<template>
  <div id="app" v-cloak>
    <top></top>
    <keep-alive>
      <router-view />
    </keep-alive>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
import top from "./components/top/top";
export default {
  name: "App",
  components: {
    top,
    page: "",
  },
  created() {
    this.getUrl();
  },
  methods: {
    ...mapMutations(["getList", "getUrlId","getUrlPage","getUrlName"]),
    // 获取地址
    getUrl() {
      var url = window.location.href;
      var temp1 = url.split("?")[1];
      var pram2 = new URLSearchParams("?" + temp1);
      this.getUrlId(pram2.get("id").replace('#/',''));
      this.getUrlPage(pram2.get("page").replace('#/',''));
      this.getUrlName(pram2.get("name").replace('#/',''))
    },
  },
};
</script>

<style>
#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-width: 1250px;
  font-weight: 400;
  background-color: #1e222b;
}
* {
  box-sizing: border-box;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
